package cn.itcast.clients;


import cn.itcast.config.FeignClientConfiguration;
import cn.itcast.fallback.UserClientFallBackFactory;
import cn.itcast.entity.Result;
import cn.itcast.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

@FeignClient(value = "user-service",
        configuration = FeignClientConfiguration.class
        , fallbackFactory = UserClientFallBackFactory.class
)
public interface UserClients {
    @PostMapping("/user/add")
    public Result<User> addUser(User user);

    @GetMapping("/user/{id}")
    public Result<User> findById(@PathVariable Long id);

}
